{#**
*
* 功能描述（订单列表模板）
*
* @author suoya <jlusuoya@gmail.com>
* @version 1
*#}

{#include file="header.tpl" title="订单" menuIdx=2 headImg="user" #}
{#include file="define.tpl" scope=parent#}
<div class="block box" >
    <div id="ur_here" class="user_here">
        当前位置: <a href=".">首页</a> <code>/</code> 用户中心 <code>/</code> 我的订单 </div>
</div>
<div class="block clearfix">  
    <div class="AreaR" style="width:996px">
        <div class="box">
            <div class="box_1">
                <div class="userCenterBox boxCenterList clearfix" style="_height:1%;">
                    <script type="text/javascript">
                        function showMyComment(rec_id)
                        {
                            $.blockUI({
                                message: $('#comment_' + rec_id), css: {
                                    top: ($(window).height() - $('#comment_' + rec_id).outerHeight()) / 2 + 'px',
                                    left: ($(window).width() - $('#comment_' + rec_id).outerWidth()) / 2 + 'px'
                                }
                            });
                        }
                    </script>
                    {#if $totalCnt > 0#}
                        <div class="user_order_ok">
                            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                <tbody>
                                    {#foreach $orderlist as $item #}
                                        <tr>
                                            <td align="left" colspan="4">
                                                <em style="display:block;float:left;">
                                                    <span>
                                                    订单编号：<a href="index.php?action=order.detail&id={#$item['id']#}" class="f6">{#$item['id']+$orderid_base#}</a>
                                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                                    下单时间：{#$item['createtime']#}
                                                    </span>
                                                </em>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="440">
                                                <table width="100%" style="margin-bottom:20px;">
                                                    <tbody>
                                                        {#foreach $goods[$item['id']] as $good#}
                                                            <tr>
                                                                <td align="center" width="80"><a target="_blank" href="index.php?action=food.detail&id={#$good['good_id']#}&version={#$good['version']#}"><img width="60" height="60" src="data/cake/cake_{#$good['good_id']#}.jpg"></a><br><a style="color:#000;text-decoration:none;" target="_blank" href="index.php?action=food.detail&id={#$good['good_id']#}&version={#$good['version']#}">{#$good['name']#}</a></td>
                                                                <td align="center" width="80">￥{#$good['price']#}元  * {#$good['cnt']#}<br/>规格：{#$good['size']#}</td>
                                                                <td align="center" width="200">
                                                                    {#if $item['status'] != 2#}
                                                                        不可评价
                                                                    {#elseif $good['comment_id'] == 0#}
                                                                        <a href="#" class="dc_comment" onclick="jQuery.WboxAction.showCommentBox({#$good['id']#});">评价商品</a>
                                                                    {#else#}
                                                                        已评价
                                                                    {#/if#}
                                                                </td>
                                                            </tr>
                                                        {#/foreach#}
                                                    </tbody></table>	
                                            </td>
                                            <td align="center" width="170" class="uo_border">共￥{#$item['amount']#}元</td>
                                            <td align="center" width="205" class="uo_border_r">
                                                {#$o_sta[$item['status']]#},{#$p_sta[$item['pay_status']]#},{#$p_type[$item['pay_type']]#}
												{#if $item['pay_status'] == 0#}
												<button onclick='window.location.href="index.php?action=order.pay&id={#$item['id']#}"'>
												立即付款￥{#$item['amount']#}元</button>{#/if#}
                                            </td>
                                            <td align="center" class="f8">[<a href="#" onclick="if (!confirm('您确认要取消该订单吗？取消后此订单将视为无效订单'))
                                                        return false;
                                                    window.location.href = 'index.php?action=order.cancel&id={#$item['id']#}'">取消订单</a>]<br><a href="index.php?action=order.detail&id={#$item['id']#}" class="f6">[订单详情]</a></td>
                                        </tr>
                                    {#/foreach#}
                                </tbody>
                            </table>
                        </div>
                    {#/if#}
                    {#include file="paging_bar.tpl"#}
                </div>
            </div>
        </div>
    </div>

</div>
{#include file="footer.tpl"#}

<div class="blank"></div>
